<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>各种表单</title>
</head>
<body>
    <div id="app">
        <h1>主要是v-model的用法</h1>

        <!-- 输入框 -->
        <input type="text" v-model="message" placeholder="edit me"> message: {{message}} <br>

        <!-- 多行文本-->
        <textarea v-model="multiMessage" cols="30" rows="3"></textarea>
        <br> multiMessage: {{multiMessage}}
        <br> multiMessage: <span style="white-space: pre-line;">{{multiMessage}}</span>

        <!-- 复选框 -->
        <br><br>复选框<br>
        <input type="checkbox" id="cb1" v-model="checked">
        <label for="cb1">{{checked}}</label>

        <br><br><br>复杂的多选框<br>
        <div id="checkboxExample1">
            <input type="checkbox" id="jack" value="I'm Jack" v-model="checkedNames">
            <label>Jack</label>
            <input type="checkbox" id="john" value="I'm John" v-model="checkedNames">
            <label for="john">john</label>
            <input type="checkbox" id="mike" value="I'm Mike" v-model="checkedNames">
            <label for="mike">Mike</label>
        </div>
        <span> 选中的名字: {{checkedNames}} </span>

        <br><br><br>单选框<br>
        <div id="radioExample1">
                <input type="radio" id="jack" value="I'm Jack" v-model="radioName">
                <label for="jack">Jack</label><br>
                <input type="radio" id="john" value="I'm John" v-model="radioName">
                <label>john</label><br>
                <input type="radio" id="mike" value="I'm Mike" v-model="radioName">
                <label for="mike">Mike</label><br>
        </div>
        <span> 选中的名字: {{radioName}} </span>
    

    </div>
</body>
<script src="../lib/vue.min.js"></script>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            message:"",
            multiMessage: "1\n2\n3",
            checked: true,
            checkedNames: [],
            radioName:"",
        },
    })
</script>
</html>